-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: improve ()
and Option<T>
type handling
#2777
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// before contract.functions.type_then_void_then_type(42, 43) contract.functions.type_then_option(42, undefined)// after contract.functions.type_then_void_then_type(42, undefined, 43) contract.functions.type_then_option(42)
Context question, how come we are treating these two things differently? I'd expect to pass ()
and Option::None
in the same way?
They are treated the same - maybe the example that I provided is confusing - I've updated the example, please let me know if that clears it up. |
@petertonysmith94 thankyou for clearing it up. Makes sense, we are treating them the same, it is actually dependent on their position in the function arguments that had thrown me off. |
Correct - do you think the breaking change description needs work? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
…/feat/void-coder
1b15522
Coverage Report:
Changed Files:
|
@petertonysmith94 change for breaking changes maybe? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean 🧹
VoidCoder
#2532empty
type for ABI Coder and Typegen #2148Option<x>
optional with typegen #2788Release notes
In this release, we:
()
andOption<T>
typesSummary
Option<T>
property optional.VoidCoder
, enabling encoding and decoding void types.Breaking Changes
()
andOption<T>
Sway types are now either required or optional, dependent on where the argument appears in the function arguments.Given these Sway functions:
This is what changes:
Checklist
tests
to prove my changesdocs